<!DOCTYPE html>
<head xmlns:v-bind="http://www.w3.org/1999/xhtml" >
    <meta charset="UTF-8">
    <title>demo14-vue自定义指令-钩子【颜色】</title>
  <script src="./js/vue.min.js"></script>

</head>

<body>
   <div id="app">
    <div v-runoob="{color:'green',text:'菜鸟教程'}"></div>
   </div>

</body>

<script type="application/javascript">
  //注册
  Vue.directive('runoob',function (el, bingding) {
    el.innerHTML = bingding.value.text;
    el.style.backgroundColor = bingding.value.color;
  });
  new Vue({
    el: "#app"
  })


</script>
</html>
